/* --------------------------------------------------------------------------------
 * PropellentNet: Propeller IDE
 * Copyright 2008 - Jason Wood
 * --------------------------------------------------------------------------------
 * propellentEditor.cs
 * Wrapper containing the Code Editor (editor.cs).
 * --------------------------------------------------------------------------------
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 * 
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 * --------------------------------------------------------------------------------
 */

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using System.IO;

namespace PropellentNet_POC
{
    public partial class CodeEditorContainer : UserControl
    {

        #region Privates
        private string m_File;
        #endregion Privates

        #region Publics
        public delegate void exTextChanged(object sender, EventArgs e);
        public event exTextChanged TextChanged;
        public delegate void exClose(object sender, EventArgs e);
        public event exClose Close;
        public delegate void exFullSource(object sender, EventArgs e);
        public event exFullSource FullSource;
        public delegate void exDocumentation(object sender, EventArgs e);
        public event exDocumentation Documentation;
        #endregion Publics

        #region De/Constructure
        public CodeEditorContainer()
        {
            InitializeComponent();
        }
        #endregion De/Constructure

        #region Events
        private void propellentEditor_Load(object sender, EventArgs e)
        {

        }
        private void rtbCode_TextChanged(object sender, EventArgs e)
        {
            if (TextChanged != null)
                TextChanged(sender, e);
        }
        private void cmdClose_Click(object sender, EventArgs e)
        {
            if (Close != null)
                Close(sender, e);
        }
        private void rdbFullSource_CheckedChanged(object sender, EventArgs e)
        {
            if (rdbFullSource.Checked)
                FullSource(sender, e);
            else
                Documentation(sender, e);
        }
        #endregion Events

        #region Public Functions
        public string GetText()
        {
            return this.rtbCode.Text;
        }
        public void SetText(string text)
        {
            this.rtbCode.Text = text;
        }
        #endregion Public Functions

    }
}
